﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FTchina.SMSServer;
using FTchina;
using System.Text;

public partial class smstask_monifasong : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        string count = FTchina.basic.SafeRequest(Request["count"]);
        string url = "http://localhost:8080/smstask/receive.aspx";
        string[] senderid = { "32a8eb82ea964b5caf33d5eec7842369", "27405d01e99b4b08b49702c2b19a3dbf", "047a11ddf8844f2fa2b9ecb14f93f74b", "b80b1a1cfc8f4cb48d695c902476c8e4", "9f6ebbfc68ee46378744f9b7a1f5f16a", "3e82430a58b94351b26473910e7671c9" };


        string parm = string.Empty;
        string content = string.Empty;
        string target = string.Empty;
        Random rd = new Random(new Guid().GetHashCode());
        int countn = 10;
        if (count.Length > 0) countn = Convert.ToInt32(count);
        for (int i = 0; i < countn; i++)
        {
            parm = "senderid=" + senderid[rd.Next(0, 6)] + "&target=" + GetTagets(countn) + "&content=" + basic.GetGuid(basic.RandEnum.Chinese, 60);
            basic.Post2Http(url, Encoding.UTF8, parm);
        }
    }

    /// <summary>
    /// 获取很多人
    /// </summary>
    /// <returns></returns>
    protected string GetTagets(int countn)
    {
        string tmp = string.Empty;
        for (int i = 0; i < countn; i++)
        {
            tmp += SMSServer.GetRadomPhone() + ",";
        }
        return tmp;
    }
}